package com.ruoyi.project.user.company.controller;

import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.page.TableDataInfo;
import com.ruoyi.project.user.company.domain.Planner;
import com.ruoyi.project.user.company.service.PlannerService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 策划师Controller
 *
 */
@Controller
@RequestMapping("/user/company/planner")
public class PlannerController extends BaseController {


    private String prefix = "user/company/planner";

    @Autowired
    private PlannerService plannerService;

    @GetMapping()
    @RequiresPermissions("user:company:view")
    public String planner(){
        return prefix+ "/planner";
    }


    @ResponseBody
    @PostMapping("/list")
    @RequiresPermissions("user:company:list")
    public TableDataInfo list(Planner planner){
        System.out.println(planner);
        startPage();
        List<Planner> plannerList = plannerService.selectAll(planner);
        return getDataTable(plannerList);
    }



}
